Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

track sold out products INREL-3676#101

Open
mgoedecke wants to merge 1 commit into
8.x-3.x-devfrom
feature/INREL-3676
Open

track sold out products INREL-3676#101
mgoedecke wants to merge 1 commit into
8.x-3.x-devfrom
feature/INREL-3676

Conversation

@mgoedecke
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread infinite.theme
->setAttribute('data-uuid', $product->uuid->value)
->setAttribute('data-product-id', $product->product_id->value);
->setAttribute('data-product-id', $product->product_id->value)
->setAttribute('data-sold-out', (string)$product->product_sold_out->value === "1" ? 'true' : 'false');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we leave it clean without transforming the data? Something like: ->setAttribute('data-sold-out', (string)$product->product_sold_out->value

initialize: function (pOptions) {
BaseView.prototype.initialize.call(this, pOptions);

if (this.$el.hasClass('item-product--sold-out')) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this has to be removed. Can you clarify?

productCategory: this.model.get('productCategory'),
containerType: this.model.get('containerType') || ''
containerType: this.model.get('containerType') || '',
soldOut: this.$el.attr('data-sold-out') === 'true'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of getting the data here we could set the data on the model directly (and also transform data there):
this.model.set('sold-out', this.$el.data('sold-out') === 1 ? 'true' : 'false'). See Line 85.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afterwards it's just a simple soldOut: this.model.get('sold-out')

Copy link
Copy Markdown
Contributor

@saviomuc saviomuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some small suggestions. Please clarify what value we need to pass: Number (1,0), Boolean or String.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants